<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>image_to_memory_block [HALCON算子参考手册]</title>
<style type="text/css">
      body {
    color: #000000;
    background-color: #ffffff;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.body_main {
    margin-left: 35px;
    margin-right: 35px;
}

@media screen and (min-width:992px) {

    .body_main {
        margin-left: 10%;
        margin-right: 10%;
    }

    table.toctable {
        width: 80%
    }
}

@media screen and (min-width:1400px) {

    .body_main {
        margin-left: 15%;
        margin-right: 15%;
    }

    table.toctable {
        width: 70%
    }
}

body>div ul ul {
    margin-left: inherit;
}

a:link {
    color: #0044cc;
}

a:link,
a:visited {
    text-decoration: none;
}

a:link:hover,
a:visited:hover {
    text-decoration: underline;
}

th {
    text-align: left;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-rendering: optimizeLegibility;
    color: #666666;
}

code {
    font-family: monospace,monospace;
}

h1 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

h2 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

hr {
    border: 0;
    border-top: solid 1px #f28d26;
}

.pre {
    display: block;
    padding-bottom: 1ex;
    font-family: monospace;
    white-space: pre;
}

pre {
    font-family: monospace, monospace;
    padding: 1ex;
    white-space: pre-wrap;
}

.toc {
    font-size: 80%;
    border-top: 1px dashed #f28d26;
    border-bottom: 1px dashed #f28d26;
    padding-top: 5px;
    padding-bottom: 5px;
}

.inv {
    margin: 0;
    border: 0;
    padding: 0;
}

.banner {
    color: #666666;
    padding-left: 1em;
}

.logo {
    background-color: white;
}

.keyboard {
    font-size: 80%;
    padding-left: 3px;
    padding-right: 3px;
    border-radius: 5px;
    border-width: 1px;
    border-style: solid;
    border-color: #f28d26;
    background-color: #f3f3f3;
}

.warning {
    margin-top: 2ex;
    margin-bottom: 1ex;
    padding: 10px;
    text-align: center;
    border: 1px solid;
    color: #bb0000;
    background-color: #fff7f7
}

.imprint {
    margin-top: 1ex;
    font-size: 80%;
    color: #666666;
}

.imprinthead {
    font-weight: bolder;
    color: #666666;
}

.indexlink {
    text-align: right;
    padding-bottom: 5px;
}

.postscript {
    margin-top: 2ex;
    font-size: 80%;
    color: #666666
}

.evenrow {
    background-color: #e7e7ef;
    vertical-align: top;
}

.oddrow {
    background-color: #f7f7ff;
    vertical-align: top;
}

.headrow {
    background-color: #97979f;
    color: #ffffff;
    vertical-align: top;
}

.logorow {
    vertical-align: top;
}

.error {
    color: red;
}

.var {
    font-style: italic
}

.halconoperator {
    font-family: monospace, monospace;
}

span.operator {
    font-family: monospace, monospace;
}

span.procedure {
    font-family: monospace, monospace;
}

span.operation {
    font-family: monospace, monospace;
}

span.feature {
    font-family: Arial, Helvetica, Homerton, sans-serif;
}

ul {
    padding-left: 1.2em;
}

li.dot {
    list-style-type: square;
    color: #f28d26;
}

.breadcrumb {
    font-size: 80%;
    color: white;
    background-color: #062d64;
    margin-bottom: 20px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 15px;
}

.webbar {
    font-size: 80%;
    background-color: #dddddd;
    margin-top: 0px;
    margin-left: -35px;
    margin-right: -35px;
    margin-bottom: 0px;
    padding-top: 5px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 5px;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-top: 1px dashed #f28d26;
    font-size: 80%;
    color: #666666;
    padding-bottom: 8px;
}

.footer .socialmedia a {
    padding-left: 7px;
}

.socialmedia {
    padding-top: 10px;
}

.copyright {
    margin-top: 19px;
}

.breadcrumb a {
    color: #ffffff;
    border-bottom: 1px solid white;
}

.breadcrumb a:link:hover,
.breadcrumb a:visited:hover {
    text-decoration: none;
    border-bottom: none;
}

.heading {
    margin-top: 1ex;
    font-size: 110%;
    font-weight: bold;
    color: #666666;
}

.text {
    color: black;
}

.example {
    font-size: 80%;
    background-color: #f3f3f3;
    border: 1px dashed #666666;
    padding: 10px;
}

.displaymath {
    display: block;
    text-align: center;
    margin-top: 1ex;
    margin-bottom: 1ex;
}

.title {
    float: left;
    padding-top: 3px;
    padding-bottom: 3px;
}

.signnote {
    font-family: Arial, Helvetica, Homerton, sans-serif;
    font-size: 80%;
    color: #666666;
    font-weight: lighter;
    font-style: italic
}

.par {
    margin-bottom: 1.5em;
}

.parhead {
    text-align: right;
}

.parname {
    float: left;
}

.pardesc {
    font-size: 85%;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 2em;
}

.parcat {
    color: #666;
    font-weight: bold;
}

*[data-if=cpp],
*[data-if=c],
*[data-if=dotnet],
*[data-if=com],
*[data-if=python] {
    display: none;
}

.tabbar {
    text-align: right;
    border-bottom: 1px solid #f28d26;
    margin-bottom: 0.5em;
}

ul.tabs {
    padding-top: 3px;
    padding-bottom: 3px;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 80%
}

ul.tabs li {
    padding-top: 3px;
    padding-bottom: 3px;
    display: inline;
    overflow: hidden;
    list-style-type: none;
    margin: 0;
    margin-left: 8px;
    border-top: 1px solid #666;
    border-left: 1px solid #666;
    border-right: 1px solid #666;
}

ul.tabs li.active {
    border-left: 1px solid #f28d26;
    border-right: 1px solid #f28d26;
    border-top: 1px solid #f28d26;
    border-bottom: 1px solid #fff;
}

ul.tabs li.inactive {
    background-color: #eee;
}

ul.tabs li a {
    padding-left: 5px;
    padding-right: 5px;
    color: #666;
}

ul.tabs li a:link:hover {
    text-decoration: none;
}

ul.tabs li.inactive a {
    color: #666;
}

ul.tabs li.active a {
    color: black;
}

dl.generic dd {
    margin-bottom: 1em;
}

.pari {
    color: olive;
}

.paro {
    color: maroon;
}

.comment {
    font-size: 80%;
    color: green;
    white-space: nowrap;
}

table.grid {
    border-collapse: collapse;
}

table.grid td {
    padding: 5px;
    border: 1px solid;
}

table.layout {
    border: 0px;
}

table.layout td {
    padding: 5px;
}

table.table {
    border-collapse: collapse;
}

table.table td {
    padding: 5px;
    border-left: 0px;
    border-right: 0px;
}

table.table tr:last-child {
    border-bottom: 1px solid;
}

table.table th {
    padding: 5px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    border-left: 0px;
    border-right: 0px;
}

.details_summary {
    cursor: pointer;
}

table.toctable {
    width: 100%;
}

table.toctable col:first-child {
    width: 20%;
}

table.toctable col:nth-last-child(2) {
    width: 8%;
}

table.altcolored tr:nth-child(even) {
    background-color: #f3f3f3;
}

    </style>
<!--OP_REF_STYLE_END-->
<script>
    <!--
var active_lang='hdevelop';function switchVisibility(obj,active_lang,new_lang)
{var display_style='inline';
for(var i=0;i<obj.length;i++)
{if(obj.item(i).getAttribute('data-if')==new_lang)
{obj.item(i).style.display=display_style;}
if(obj.item(i).getAttribute('data-if')==active_lang)
{obj.item(i).style.display='none';}}
return;}
function toggleLanguage(new_lang,initial)
{if(active_lang!=new_lang)
{var lis=document.getElementsByTagName('li');for(var i=0;i<lis.length;i++)
{if(lis.item(i).id=='syn-'+new_lang)
{lis.item(i).className='active';}
else
{lis.item(i).className='inactive';}}
var divs=document.getElementsByTagName('div');var spans=document.getElementsByTagName('span');switchVisibility(divs,active_lang,new_lang);switchVisibility(spans,active_lang,new_lang);if(!initial)
{setCookie("halcon_reference_language",new_lang,null,null);}
active_lang=new_lang;}
return;}
function setCookie(name,value,domain,exp_offset,path,secure)
{localStorage.setItem(name,value);}
function getCookie(name)
{return localStorage.getItem(name);}
function initialize()
{var qs=location.href.split('?')[1];var qs_lang_raw=location.href.split('interface=')[1];var qs_lang;if(qs_lang_raw)
{qs_lang=qs_lang_raw.split('#')[0];}
var cookie_lang=getCookie("halcon_reference_language");var new_lang;if((qs_lang=="hdevelop")||(qs_lang=="dotnet")||(qs_lang=="python")||(qs_lang=="cpp")||(qs_lang=="c"))
{new_lang=qs_lang;setCookie("halcon_reference_language",new_lang,null,null);}
else if((cookie_lang=="hdevelop")||(cookie_lang=="dotnet")||(cookie_lang=="python")||(cookie_lang=="cpp")||(cookie_lang=="c"))
{new_lang=cookie_lang;}
else
{new_lang="hdevelop";}
toggleLanguage(new_lang,1);return;}
-->

  </script>
</head>
<body onload="initialize();">
<div class="breadcrumb">
<br class="inv"><a href="index.html">目录</a> / <a href="toc_file.html">File</a> / <a href="toc_file_images.html">Images</a><br class="inv">
</div>
<div class="body_main">
<div class="tabbar"><ul class="tabs">
<li id="syn-hdevelop" class="active"><a href="javascript:void(0);" onclick="toggleLanguage('hdevelop')" onfocus="blur()">HDevelop</a></li>
<li id="syn-dotnet" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('dotnet')" onfocus="blur()">.NET</a></li>
<li id="syn-python" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('python')" onfocus="blur()">Python</a></li>
<li id="syn-cpp" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('cpp')" onfocus="blur()">C++</a></li>
<li id="syn-c" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('c')" onfocus="blur()">C</a></li>
</ul></div>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<!--OP_REF_HEADER_END-->
<h1 id="sec_name">
<span data-if="hdevelop" style="display:inline;">image_to_memory_block</span><span data-if="c" style="display:none;">T_image_to_memory_block</span><span data-if="cpp" style="display:none;">ImageToMemoryBlock</span><span data-if="dotnet" style="display:none;">ImageToMemoryBlock</span><span data-if="python" style="display:none;">image_to_memory_block</span> (算子名称)</h1>
<h2>名称</h2>
<p><code><span data-if="hdevelop" style="display:inline;">image_to_memory_block</span><span data-if="c" style="display:none;">T_image_to_memory_block</span><span data-if="cpp" style="display:none;">ImageToMemoryBlock</span><span data-if="dotnet" style="display:none;">ImageToMemoryBlock</span><span data-if="python" style="display:none;">image_to_memory_block</span></code> — Write an image to a memory block in various graphic formats.</p>
<h2 id="sec_synopsis">参数签名</h2>
<div data-if="hdevelop" style="display:inline;">
<p>
<code><b>image_to_memory_block</b>(<a href="#Image"><i>Image</i></a> :  : <a href="#Format"><i>Format</i></a>, <a href="#FillColor"><i>FillColor</i></a> : <a href="#MemoryBlockHandle"><i>MemoryBlockHandle</i></a>)</code></p>
</div>
<div data-if="c" style="display:none;">
<p>
<code>Herror <b>T_image_to_memory_block</b>(const Hobject <a href="#Image"><i>Image</i></a>, const Htuple <a href="#Format"><i>Format</i></a>, const Htuple <a href="#FillColor"><i>FillColor</i></a>, Htuple* <a href="#MemoryBlockHandle"><i>MemoryBlockHandle</i></a>)</code></p>
</div>
<div data-if="cpp" style="display:none;">
<p>
<code>void <b>ImageToMemoryBlock</b>(const HObject&amp; <a href="#Image"><i>Image</i></a>, const HTuple&amp; <a href="#Format"><i>Format</i></a>, const HTuple&amp; <a href="#FillColor"><i>FillColor</i></a>, HTuple* <a href="#MemoryBlockHandle"><i>MemoryBlockHandle</i></a>)</code></p>
<p>
<code><a href="HMemoryBlock.html">HMemoryBlock</a> <a href="HImage.html">HImage</a>::<b>ImageToMemoryBlock</b>(const HString&amp; <a href="#Format"><i>Format</i></a>, const HTuple&amp; <a href="#FillColor"><i>FillColor</i></a>) const</code></p>
<p>
<code><a href="HMemoryBlock.html">HMemoryBlock</a> <a href="HImage.html">HImage</a>::<b>ImageToMemoryBlock</b>(const HString&amp; <a href="#Format"><i>Format</i></a>, Hlong <a href="#FillColor"><i>FillColor</i></a>) const</code></p>
<p>
<code><a href="HMemoryBlock.html">HMemoryBlock</a> <a href="HImage.html">HImage</a>::<b>ImageToMemoryBlock</b>(const char* <a href="#Format"><i>Format</i></a>, Hlong <a href="#FillColor"><i>FillColor</i></a>) const</code></p>
<p>
<code><a href="HMemoryBlock.html">HMemoryBlock</a> <a href="HImage.html">HImage</a>::<b>ImageToMemoryBlock</b>(const wchar_t* <a href="#Format"><i>Format</i></a>, Hlong <a href="#FillColor"><i>FillColor</i></a>) const  <span class="signnote">
            (
            Windows only)
          </span></code></p>
</div>
<div data-if="com" style="display:none;"></div>
<div data-if="dotnet" style="display:none;">
<p>
<code>static void <a href="HOperatorSet.html">HOperatorSet</a>.<b>ImageToMemoryBlock</b>(<a href="HObject.html">HObject</a> <a href="#Image"><i>image</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Format"><i>format</i></a>, <a href="HTuple.html">HTuple</a> <a href="#FillColor"><i>fillColor</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#MemoryBlockHandle"><i>memoryBlockHandle</i></a>)</code></p>
<p>
<code><a href="HMemoryBlock.html">HMemoryBlock</a> <a href="HImage.html">HImage</a>.<b>ImageToMemoryBlock</b>(string <a href="#Format"><i>format</i></a>, <a href="HTuple.html">HTuple</a> <a href="#FillColor"><i>fillColor</i></a>)</code></p>
<p>
<code><a href="HMemoryBlock.html">HMemoryBlock</a> <a href="HImage.html">HImage</a>.<b>ImageToMemoryBlock</b>(string <a href="#Format"><i>format</i></a>, int <a href="#FillColor"><i>fillColor</i></a>)</code></p>
</div>
<div data-if="python" style="display:none;">
<p>
<code>def <b>image_to_memory_block</b>(<a href="#Image"><i>image</i></a>: HObject, <a href="#Format"><i>format</i></a>: str, <a href="#FillColor"><i>fill_color</i></a>: Union[int, float]) -&gt; HHandle</code></p>
</div>
<h2 id="sec_description">描述</h2>
<p>该算子 <code><span data-if="hdevelop" style="display:inline">image_to_memory_block</span><span data-if="c" style="display:none">image_to_memory_block</span><span data-if="cpp" style="display:none">ImageToMemoryBlock</span><span data-if="com" style="display:none">ImageToMemoryBlock</span><span data-if="dotnet" style="display:none">ImageToMemoryBlock</span><span data-if="python" style="display:none">image_to_memory_block</span></code> saves the input image
<a href="#Image"><i><code><span data-if="hdevelop" style="display:inline">Image</span><span data-if="c" style="display:none">Image</span><span data-if="cpp" style="display:none">Image</span><span data-if="com" style="display:none">Image</span><span data-if="dotnet" style="display:none">image</span><span data-if="python" style="display:none">image</span></code></i></a> to the memory block <a href="#MemoryBlockHandle"><i><code><span data-if="hdevelop" style="display:inline">MemoryBlockHandle</span><span data-if="c" style="display:none">MemoryBlockHandle</span><span data-if="cpp" style="display:none">MemoryBlockHandle</span><span data-if="com" style="display:none">MemoryBlockHandle</span><span data-if="dotnet" style="display:none">memoryBlockHandle</span><span data-if="python" style="display:none">memory_block_handle</span></code></i></a> in the format
<a href="#Format"><i><code><span data-if="hdevelop" style="display:inline">Format</span><span data-if="c" style="display:none">Format</span><span data-if="cpp" style="display:none">Format</span><span data-if="com" style="display:none">Format</span><span data-if="dotnet" style="display:none">format</span><span data-if="python" style="display:none">format</span></code></i></a>. If the domain (region) cannot be saved in the specified
<a href="#Format"><i><code><span data-if="hdevelop" style="display:inline">Format</span><span data-if="c" style="display:none">Format</span><span data-if="cpp" style="display:none">Format</span><span data-if="com" style="display:none">Format</span><span data-if="dotnet" style="display:none">format</span><span data-if="python" style="display:none">format</span></code></i></a> (this is the case for 'jpeg'), all pixels outside the region
receive the color defined by <a href="#FillColor"><i><code><span data-if="hdevelop" style="display:inline">FillColor</span><span data-if="c" style="display:none">FillColor</span><span data-if="cpp" style="display:none">FillColor</span><span data-if="com" style="display:none">FillColor</span><span data-if="dotnet" style="display:none">fillColor</span><span data-if="python" style="display:none">fill_color</span></code></i></a>. For gray value images a value
between <i>0</i> (black) and <i>255</i> (white) must be passed. For RGB
color images the RGB values can be passed directly as a hexadecimal value:
e.g., <i>0xffff00</i> for a yellow background (red=255, green=255, blue=0).
</p>
<p>The following formats can be set in <a href="#Format"><i><code><span data-if="hdevelop" style="display:inline">Format</span><span data-if="c" style="display:none">Format</span><span data-if="cpp" style="display:none">Format</span><span data-if="com" style="display:none">Format</span><span data-if="dotnet" style="display:none">format</span><span data-if="python" style="display:none">format</span></code></i></a>:
</p>
<dl class="generic">


<dt><b>'jpeg': JPEG format (lossy compression), file extension *.jpg</b></dt>
<dd>


<p>This format can only store images with one channel (gray value image) or three
channels (RGB image).
</p>
<p>Only images with the pixel type byte are supported for this file format.
</p>
<p>Together with the format string the quality value determining the compression
rate can be provided. Large values (maximum 100) create a large memory block
with high image quality. Small values significantly decrease the image quality
and the size of the memory block.
</p>
<p><i>Possible values:</i> <i><span data-if="hdevelop" style="display:inline">'jpeg'</span><span data-if="c" style="display:none">"jpeg"</span><span data-if="cpp" style="display:none">"jpeg"</span><span data-if="com" style="display:none">"jpeg"</span><span data-if="dotnet" style="display:none">"jpeg"</span><span data-if="python" style="display:none">"jpeg"</span></i>, <i><span data-if="hdevelop" style="display:inline">'jpeg 30'</span><span data-if="c" style="display:none">"jpeg 30"</span><span data-if="cpp" style="display:none">"jpeg 30"</span><span data-if="com" style="display:none">"jpeg 30"</span><span data-if="dotnet" style="display:none">"jpeg 30"</span><span data-if="python" style="display:none">"jpeg 30"</span></i>,
<i><span data-if="hdevelop" style="display:inline">'jpeg 60'</span><span data-if="c" style="display:none">"jpeg 60"</span><span data-if="cpp" style="display:none">"jpeg 60"</span><span data-if="com" style="display:none">"jpeg 60"</span><span data-if="dotnet" style="display:none">"jpeg 60"</span><span data-if="python" style="display:none">"jpeg 60"</span></i>.
</p>
<p><i>Attention:</i> Images stored for being processed later should not be
stored in this format due to the loss of information during compression.
</p>
</dd>

<dt><b>'png': PNG format (lossless compression), file extension *.png</b></dt>
<dd>


<p>This format can only store images with one channel (gray value image) or three
channels (RGB image). The maximal supported image size (width x height) for
PNG is <span title="1" style="vertical-align:-0.155012em" class="math"><!-- Created by MetaPost 1.902 on 2023.05.15:2033 --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="3.18398em" height="1.01898em" viewBox="0 0 50.943710 16.303741">
<!-- Original BoundingBox: -25.471863 -8.151871 25.471848 8.151871 -->
  <defs>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmr10_49">
      <path style="fill-rule: evenodd;" d="M294.000000 -640.000000C294.000000 -664.000000,294.000000 -666.000000,271.000000 -666.000000C209.000000 -602.000000,121.000000 -602.000000,89.000000 -602.000000L89.000000 -571.000000C109.000000 -571.000000,168.000000 -571.000000,220.000000 -597.000000L220.000000 -79.000000C220.000000 -43.000000,217.000000 -31.000000,127.000000 -31.000000L95.000000 -31.000000L95.000000 -0.000000L257.000000 -0.000000L130.000000 -3.000000L217.000000 -3.000000L257.000000 -3.000000L297.000000 -3.000000L384.000000 -3.000000L419.000000 -0.000000L419.000000 -31.000000L387.000000 -31.000000C297.000000 -31.000000,294.000000 -42.000000,294.000000 -79.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmr10_50">
      <path style="fill-rule: evenodd;" d="M127.000000 -77.000000L233.000000 -180.000000C389.000000 -318.000000,449.000000 -372.000000,449.000000 -472.000000C449.000000 -586.000000,359.000000 -666.000000,237.000000 -666.000000C124.000000 -666.000000,50.000000 -574.000000,50.000000 -485.000000C50.000000 -429.000000,100.000000 -429.000000,103.000000 -429.000000C120.000000 -429.000000,155.000000 -441.000000,155.000000 -482.000000C155.000000 -508.000000,137.000000 -534.000000,102.000000 -534.000000C94.000000 -534.000000,92.000000 -534.000000,89.000000 -533.000000C112.000000 -598.000000,166.000000 -635.000000,224.000000 -635.000000C315.000000 -635.000000,358.000000 -554.000000,358.000000 -472.000000C358.000000 -392.000000,308.000000 -313.000000,253.000000 -251.000000L61.000000 -37.000000C50.000000 -26.000000,50.000000 -24.000000,50.000000 -0.000000L421.000000 -0.000000L449.000000 -174.000000L424.000000 -174.000000C419.000000 -144.000000,412.000000 -100.000000,402.000000 -85.000000C395.000000 -77.000000,329.000000 -77.000000,307.000000 -77.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmsy10_0">
      <path style="fill-rule: evenodd;" d="M659.000000 -230.000000C676.000000 -230.000000,694.000000 -230.000000,694.000000 -250.000000C694.000000 -270.000000,676.000000 -270.000000,659.000000 -270.000000L118.000000 -270.000000C101.000000 -270.000000,83.000000 -270.000000,83.000000 -250.000000C83.000000 -230.000000,101.000000 -230.000000,118.000000 -230.000000"></path>
    </g>
    <g transform="scale(0.006974,0.006974)" id="GLYPHcmr7_49">
      <path style="fill-rule: evenodd;" d="M335.000000 -636.000000C335.000000 -663.000000,333.000000 -664.000000,305.000000 -664.000000C241.000000 -601.000000,150.000000 -600.000000,109.000000 -600.000000L109.000000 -564.000000C133.000000 -564.000000,199.000000 -564.000000,254.000000 -592.000000L254.000000 -82.000000C254.000000 -49.000000,254.000000 -36.000000,154.000000 -36.000000L116.000000 -36.000000L116.000000 -0.000000L294.000000 -0.000000L134.000000 -1.000000L257.000000 -4.000000L294.000000 -4.000000L325.000000 -4.000000L451.000000 -1.000000L473.000000 -0.000000L473.000000 -36.000000L435.000000 -36.000000C335.000000 -36.000000,335.000000 -49.000000,335.000000 -82.000000"></path>
    </g>
    <g transform="scale(0.006974,0.006974)" id="GLYPHcmr7_51">
      <path style="fill-rule: evenodd;" d="M273.000000 -334.000000C351.000000 -334.000000,407.000000 -280.000000,407.000000 -173.000000C407.000000 -49.000000,335.000000 -12.000000,277.000000 -12.000000C237.000000 -12.000000,149.000000 -23.000000,107.000000 -82.000000C154.000000 -84.000000,165.000000 -117.000000,165.000000 -138.000000C165.000000 -170.000000,141.000000 -193.000000,110.000000 -193.000000C82.000000 -193.000000,54.000000 -176.000000,54.000000 -135.000000C54.000000 -41.000000,158.000000 20.000000,279.000000 20.000000C418.000000 20.000000,514.000000 -73.000000,514.000000 -173.000000C514.000000 -251.000000,450.000000 -329.000000,340.000000 -352.000000C445.000000 -390.000000,483.000000 -465.000000,483.000000 -526.000000C483.000000 -605.000000,392.000000 -664.000000,281.000000 -664.000000C170.000000 -664.000000,85.000000 -610.000000,85.000000 -530.000000C85.000000 -496.000000,107.000000 -477.000000,137.000000 -477.000000C168.000000 -477.000000,188.000000 -500.000000,188.000000 -528.000000C188.000000 -557.000000,168.000000 -578.000000,137.000000 -580.000000C172.000000 -624.000000,241.000000 -635.000000,278.000000 -635.000000C323.000000 -635.000000,386.000000 -613.000000,386.000000 -526.000000C386.000000 -484.000000,372.000000 -438.000000,346.000000 -407.000000C313.000000 -369.000000,285.000000 -367.000000,235.000000 -364.000000C210.000000 -362.000000,208.000000 -362.000000,203.000000 -361.000000C201.000000 -361.000000,193.000000 -359.000000,193.000000 -348.000000C193.000000 -334.000000,202.000000 -334.000000,219.000000 -334.000000"></path>
    </g>
  </defs>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,0.544128 13.823547)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmr10_50"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,8.514252 8.038879)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmr7_51"></use>
    <use xlink:href="#GLYPHcmr7_49" x="3.986190"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,25.561508 13.823547)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmsy10_0"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,41.501724 13.823547)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmr10_49"></use>
  </g>
</svg></span>, also in HALCON XL.
</p>
<p>Images of type byte and uint2 can be stored in PNG format.
</p>
<p>Together with the format string, a compression level between 0 and 9 can be
specified, where 0 corresponds to no compression and 9 to the best possible
compression. Alternatively, the compression can be selected by using string
constants.
</p>
<p><i>Possible values:</i> <i><span data-if="hdevelop" style="display:inline">'png'</span><span data-if="c" style="display:none">"png"</span><span data-if="cpp" style="display:none">"png"</span><span data-if="com" style="display:none">"png"</span><span data-if="dotnet" style="display:none">"png"</span><span data-if="python" style="display:none">"png"</span></i>, <i><span data-if="hdevelop" style="display:inline">'png 7'</span><span data-if="c" style="display:none">"png 7"</span><span data-if="cpp" style="display:none">"png 7"</span><span data-if="com" style="display:none">"png 7"</span><span data-if="dotnet" style="display:none">"png 7"</span><span data-if="python" style="display:none">"png 7"</span></i>,
<i><span data-if="hdevelop" style="display:inline">'png none'</span><span data-if="c" style="display:none">"png none"</span><span data-if="cpp" style="display:none">"png none"</span><span data-if="com" style="display:none">"png none"</span><span data-if="dotnet" style="display:none">"png none"</span><span data-if="python" style="display:none">"png none"</span></i>, <i><span data-if="hdevelop" style="display:inline">'png best'</span><span data-if="c" style="display:none">"png best"</span><span data-if="cpp" style="display:none">"png best"</span><span data-if="com" style="display:none">"png best"</span><span data-if="dotnet" style="display:none">"png best"</span><span data-if="python" style="display:none">"png best"</span></i>, <i><span data-if="hdevelop" style="display:inline">'png fastest'</span><span data-if="c" style="display:none">"png fastest"</span><span data-if="cpp" style="display:none">"png fastest"</span><span data-if="com" style="display:none">"png fastest"</span><span data-if="dotnet" style="display:none">"png fastest"</span><span data-if="python" style="display:none">"png fastest"</span></i>.
</p>
<p>If an image with a reduced domain is written, the region is stored as the
alpha channel, where the points within the domain are stored as the maximum
gray value of the image type and the points outside the domain are stored as
the gray value 0. If an image with a full domain is written, no alpha channel
is stored.
</p>
</dd>
</dl>
<h2 id="sec_execution">运行信息</h2>
<ul>
  <li>多线程类型:可重入(与非独占操作符并行运行)。</li>
<li>多线程作用域:全局(可以从任何线程调用)。</li>
  <li>未经并行化处理。</li>
</ul>
<p>This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.</p>
<h2 id="sec_parameters">参数表</h2>
  <div class="par">
<div class="parhead">
<span id="Image" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Image</span><span data-if="c" style="display:none">Image</span><span data-if="cpp" style="display:none">Image</span><span data-if="com" style="display:none">Image</span><span data-if="dotnet" style="display:none">image</span><span data-if="python" style="display:none">image</span></code></b> (input_object)  </span><span>(multichannel-)image <code>→</code> <span data-if="hdevelop" style="display:inline">object</span><span data-if="dotnet" style="display:none"><a href="HImage.html">HImage</a></span><span data-if="python" style="display:none">HObject</span><span data-if="cpp" style="display:none"><a href="HImage.html">HImage</a></span><span data-if="c" style="display:none">Hobject</span> (byte / direction / cyclic / int1 / complex / int2 / uint2 / vector_field / int4 / int8 / real)</span>
</div>
<p class="pardesc">Input image.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="Format" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Format</span><span data-if="c" style="display:none">Format</span><span data-if="cpp" style="display:none">Format</span><span data-if="com" style="display:none">Format</span><span data-if="dotnet" style="display:none">format</span><span data-if="python" style="display:none">format</span></code></b> (input_control)  </span><span>string <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">str</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (string)</span><span data-if="dotnet" style="display:none"> (<i>string</i>)</span><span data-if="cpp" style="display:none"> (<i>HString</i>)</span><span data-if="c" style="display:none"> (<i>char*</i>)</span></span>
</div>
<p class="pardesc">Graphic format.</p>
<p class="pardesc"><span class="parcat">Default:
      </span>
    <span data-if="hdevelop" style="display:inline">'jpeg'</span>
    <span data-if="c" style="display:none">"jpeg"</span>
    <span data-if="cpp" style="display:none">"jpeg"</span>
    <span data-if="com" style="display:none">"jpeg"</span>
    <span data-if="dotnet" style="display:none">"jpeg"</span>
    <span data-if="python" style="display:none">"jpeg"</span>
</p>
<p class="pardesc"><span class="parcat">Suggested values:
      </span><span data-if="hdevelop" style="display:inline">'jpeg'</span><span data-if="c" style="display:none">"jpeg"</span><span data-if="cpp" style="display:none">"jpeg"</span><span data-if="com" style="display:none">"jpeg"</span><span data-if="dotnet" style="display:none">"jpeg"</span><span data-if="python" style="display:none">"jpeg"</span>, <span data-if="hdevelop" style="display:inline">'png'</span><span data-if="c" style="display:none">"png"</span><span data-if="cpp" style="display:none">"png"</span><span data-if="com" style="display:none">"png"</span><span data-if="dotnet" style="display:none">"png"</span><span data-if="python" style="display:none">"png"</span></p>
</div>
  <div class="par">
<div class="parhead">
<span id="FillColor" class="parname"><b><code><span data-if="hdevelop" style="display:inline">FillColor</span><span data-if="c" style="display:none">FillColor</span><span data-if="cpp" style="display:none">FillColor</span><span data-if="com" style="display:none">FillColor</span><span data-if="dotnet" style="display:none">fillColor</span><span data-if="python" style="display:none">fill_color</span></code></b> (input_control)  </span><span>number <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Union[int, float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (integer / </span><span data-if="hdevelop" style="display:inline">real)</span><span data-if="dotnet" style="display:none"> (<i>int</i> / </span><span data-if="dotnet" style="display:none">long / </span><span data-if="dotnet" style="display:none">double)</span><span data-if="cpp" style="display:none"> (<i>Hlong</i> / </span><span data-if="cpp" style="display:none">double)</span><span data-if="c" style="display:none"> (<i>Hlong</i> / </span><span data-if="c" style="display:none">double)</span></span>
</div>
<p class="pardesc">Gray value for pixels not belonging to the image domain
(region).</p>
<p class="pardesc"><span class="parcat">Default:
      </span>0</p>
<p class="pardesc"><span class="parcat">Suggested values:
      </span>-1, 0, 255, 65280, 16711680</p>
</div>
  <div class="par">
<div class="parhead">
<span id="MemoryBlockHandle" class="parname"><b><code><span data-if="hdevelop" style="display:inline">MemoryBlockHandle</span><span data-if="c" style="display:none">MemoryBlockHandle</span><span data-if="cpp" style="display:none">MemoryBlockHandle</span><span data-if="com" style="display:none">MemoryBlockHandle</span><span data-if="dotnet" style="display:none">memoryBlockHandle</span><span data-if="python" style="display:none">memory_block_handle</span></code></b> (output_control)  </span><span>memory_block <code>→</code> <span data-if="dotnet" style="display:none"><a href="HMemoryBlock.html">HMemoryBlock</a>, </span><span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">HHandle</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (handle)</span><span data-if="dotnet" style="display:none"> (<i>IntPtr</i>)</span><span data-if="cpp" style="display:none"> (<i>HHandle</i>)</span><span data-if="c" style="display:none"> (<i>handle</i>)</span></span>
</div>
<p class="pardesc">Memory block handle.</p>
</div>
<h2 id="sec_result">结果</h2>
<p>If the parameter values are correct 该算子 <code><span data-if="hdevelop" style="display:inline">image_to_memory_block</span><span data-if="c" style="display:none">image_to_memory_block</span><span data-if="cpp" style="display:none">ImageToMemoryBlock</span><span data-if="com" style="display:none">ImageToMemoryBlock</span><span data-if="dotnet" style="display:none">ImageToMemoryBlock</span><span data-if="python" style="display:none">image_to_memory_block</span></code>
返回值 <TT>2</TT> (
      <TT>H_MSG_TRUE</TT>)
    . Otherwise an exception is raised.</p>
<h2 id="sec_predecessors">可能的前置算子</h2>
<p>
<code><a href="open_window.html"><span data-if="hdevelop" style="display:inline">open_window</span><span data-if="c" style="display:none">open_window</span><span data-if="cpp" style="display:none">OpenWindow</span><span data-if="com" style="display:none">OpenWindow</span><span data-if="dotnet" style="display:none">OpenWindow</span><span data-if="python" style="display:none">open_window</span></a></code>, 
<code><a href="read_image.html"><span data-if="hdevelop" style="display:inline">read_image</span><span data-if="c" style="display:none">read_image</span><span data-if="cpp" style="display:none">ReadImage</span><span data-if="com" style="display:none">ReadImage</span><span data-if="dotnet" style="display:none">ReadImage</span><span data-if="python" style="display:none">read_image</span></a></code>
</p>
<h2 id="sec_successors">可能的后置算子</h2>
<p>
<code><a href="write_memory_block.html"><span data-if="hdevelop" style="display:inline">write_memory_block</span><span data-if="c" style="display:none">write_memory_block</span><span data-if="cpp" style="display:none">WriteMemoryBlock</span><span data-if="com" style="display:none">WriteMemoryBlock</span><span data-if="dotnet" style="display:none">WriteMemoryBlock</span><span data-if="python" style="display:none">write_memory_block</span></a></code>, 
<code><a href="serialize_tuple.html"><span data-if="hdevelop" style="display:inline">serialize_tuple</span><span data-if="c" style="display:none">serialize_tuple</span><span data-if="cpp" style="display:none">SerializeTuple</span><span data-if="com" style="display:none">SerializeTuple</span><span data-if="dotnet" style="display:none">SerializeTuple</span><span data-if="python" style="display:none">serialize_tuple</span></a></code>
</p>
<h2 id="sec_module">模块</h2>
<p>
Foundation</p>
<!--OP_REF_FOOTER_START-->
<hr>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<div class="footer">
<div class="copyright">HALCON算子参考手册 Copyright © 2015-2023 51Halcon</div>
</div>
</div>
</body>
</html>
